package com.hydl.power.mapper;


import com.hydl.power.pojo.SysUser;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.List;


@Mapper
@Component
public interface SysUserMapper {

    /**
     * 根据登录名查询用户信息
     * @param userName
     * @return
     */
    SysUser selectByUserName(@Param("userName")String userName);

    int updatePassword(@Param("id") Integer id, @Param("password") String password);

    int addUser(SysUser sysUser);

    List<SysUser> getList(@Param("pageNum") Integer pageNum,@Param("pageSize") Integer pageSize);

    /**
     * 用户删除
     * @param id
     * @return
     */
    int deleteUserById(@Param("id") Integer id);

    SysUser getAllById(@Param("id") Integer id);

    List<SysUser> getAllUser();

    /**
     * 用户修改
     * @param id
     * @return
     */
    int updateUserById(@Param("id") Integer id,@Param("username") String username,@Param("card") String card,@Param("flag") Integer flag);

    int updateLoginTime(@Param("userName") String userName);

    SysUser getUserByToken(String token);

    SysUser getUserByProjectId(String projectId);

    List<SysUser> queryUserByProjectIdList(String projectId);

    SysUser getUserByMaintainerId(Integer valueOf);

}